<template>
  <div class="avue-logo">
     <transition name="fade">
      <div v-if="keyCollapse" key="0" class="avue-logo_subtitle text-center" @click="goIndex">
        <el-image style="width: 70%; height: 60px" :src="srconlylogoUrl" fit="contain" class="menulogo"></el-image>
<!--        {{website.subtitle}}-->
      </div>
    </transition>
    <transition-group name="fade">
      <span v-if="!keyCollapse" key="1" class="avue-logo_title" @click="goIndex">
        <!-- {{ website.title }} -->
         <el-image style="width: 170px; height: 60px" :src="srclogo" fit="contain" class="menulogo"></el-image>
<!--         <div class="avue-logo_title_text">{{ website.title }}</div>-->
      </span>
    </transition-group>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import {getTitleName} from '@/api/hetongrenwu/hetongyeji/hetongnd-sp'
export default {
  name: 'Logo',
  data() {
    return {
      srclogo: '',
      srconlylogoUrl: '',
    }
  },
  computed: {
    ...mapGetters(['website', 'keyCollapse'])
  },
  created() {
    this.getTitle()
  },
  methods: {
    goIndex: function () {
      window.location.href = '/'
    },
    getTitle() {
        getTitleName().then(response => {
            this.tilDev = response.data
            if(this.tilDev=='dev'){
              this.srclogo = this.website.logoceshi
              this.srconlylogoUrl = this.website.onlylogoceshi
            }else{
              this.srclogo = this.website.logo
              this.srconlylogoUrl = this.website.onlylogo
            }
        })
    },
  }
}
</script>
